package net.zoneland.knowledge.service.impl;

import java.util.List;

import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.zoneland.knowledge.config.EsConfig;
import net.zoneland.knowledge.constant.FieldConstant;
import net.zoneland.knowledge.constant.SystemConstant;
import net.zoneland.knowledge.model.EsQuestion;
import net.zoneland.knowledge.service.DataManageService;
import net.zoneland.knowledge.service.EsService;
import net.zoneland.knowledge.utils.ElasticSearchPoolUtil;
import net.zoneland.knowledge.utils.GsonUtils;

/**
 * .
 *
 * @author: bcc
 * 2021/5/24
 */
@Service
public class DataManageServiceImpl implements DataManageService {
    /**
     * 日志.
     */
    private static final Logger LOGGER = LoggerFactory.getLogger(DataManageServiceImpl.class);


    @Autowired
    private EsService esService;

    @Override
    public List<String> dealBatch(final List<EsQuestion> list) throws Exception {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("start dealBatch");
        }
        return esService.dealBatch(list);
    }


    @Override
    public EsQuestion getById(final String id) throws Exception {
        return esService.getById(id);
    }
}
